run:
  timeout: 5m
  issues-exit-code: 1
  tests: true
  skip-dirs-use-default: true
  modules-download-mode: readonly

issues:
  max-per-linter: 0
  max-same-issues: 0

linters:
  disable-all: true
  enable:
    - bodyclose    # ensure HTTP response bodies are successfully closed.
    - contextcheck # check we are passing context an inherited context.
    - gofmt        # checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification.
    - errname      # checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`.
    - errcheck     # a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases.
    - errorlint    # used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13.
    - godot        # check if comments end in a period.
    - misspell     # finds commonly misspelled English words in comments.
    - nilerr       # checks that there is no simultaneous return of nil error and an invalid value.
    - tparallel    # detects inappropriate usage of t.Parallel() method in your Go test codes.
    - unparam      # reports unused function parameters.
    - whitespace   # detection of leading and trailing whitespace.

linters-settings:
  errcheck:
    exclude-functions:
      # fine to ignore in errcheck as tfproviderlint covers this
      - (*github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.ResourceData).Set

output:
  format: colored-line-number
